package com.woniu.common.utils.messageUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class CodeCheck {
    @Autowired
    private static StringRedisTemplate redisTemplate;

    public static boolean checkCode(String phoneNum, String code) {
        String msg = redisTemplate.opsForValue().get(phoneNum);
        if (msg.equals(code)) {
            return true;
        } else {
            return false;
        }
    }
}

